﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using QDT.Common;

namespace QDT.Web.Code.Enums
{
//    public enum Greetings
//    {
//        /// <summary>
//        /// 早上
//        /// </summary>
//        Morning=0,
//        /// <summary>
//        /// 中午
//        /// </summary>
//        Noon,
//        /// <summary>
//        /// 下午
//        /// </summary>
//        Afternoon,
//        /// <summary>
//        /// 晚上
//        /// </summary>
//        Night,
//        /// <summary>
//        /// 傍晚
//        /// </summary>
//        Evening
//    }


    public class Greetings
    {
        /// <summary>
        /// 早上
        /// </summary>
        /// <returns></returns>
        public bool Morning()
        {
            if (DateTime.Now.Hour >= 6 && DateTime.Now.Hour <= 12)
            {
                if (DateTime.Now.Hour == 12 && DateTime.Now.Minute > 0)
                {
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }

        }
        /// <summary>
        /// 中午
        /// </summary>
        /// <returns></returns>
        public bool Noon()
        {
            if (DateTime.Now.Hour >= 12 && DateTime.Now.Hour <= 14)
            {
                if (DateTime.Now.Hour == 14 && DateTime.Now.Minute > 0)
                {
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 下午
        /// </summary>
        /// <returns></returns>
        public bool Afternoon()
        {
            if (DateTime.Now.Hour >= 14 && DateTime.Now.Hour <= 18)
            {
                if (DateTime.Now.Hour == 18 && DateTime.Now.Minute > 0)
                {
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 晚上
        /// </summary>
        /// <returns></returns>
        public bool Night()
        {
            if (DateTime.Now.Hour >= 16 && DateTime.Now.Hour <= 23)
            {
                if (DateTime.Now.Hour == 23 && DateTime.Now.Minute > 0)
                {
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }
        }
        /// <summary>
        /// 傍晚
        /// </summary>
        /// <returns></returns>
        public bool Evening()
        {
            if (DateTime.Now.Hour >= 23 || DateTime.Now.Hour >= 0&&DateTime.Now.Hour<=6)
            {
                if (DateTime.Now.Hour == 6 && DateTime.Now.Minute > 0)
                {
                    return false;
                }
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}